home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Tool Chest / Dev.CD Aug 98 TC.toast / Sample Code / Development Tools & Languages / AppsToGo / DTS.Lib / TUndoTaskObj.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-22  |  2.3 KB  |  104 lines  |  [TEXT/MPS ]

  1. /*
  2. ** Apple Macintosh Developer Technical Support
  3. **
  4. ** Program:     DTS.Lib
  5. ** File:        TUndoTaskObj.c
  6. ** Written by:  Eric Soldan
  7. **
  8. ** Copyright © 1992 Apple Computer, Inc.
  9. ** All rights reserved.
  10. */
  11.  
  12. /* You may incorporate this sample code into your applications without
  13. ** restriction, though the sample code has been provided "AS IS" and the
  14. ** responsibility for its operation is 100% yours.  However, what you are
  15. ** not permitted to do is to redistribute the source as "DSC Sample Code"
  16. ** after having made changes. If you're going to re-distribute the source,
  17. ** we require that you make it clear in the source that the code was
  18. ** descended from Apple Sample Code, but that you've made changes. */
  19.  
  20. #ifndef __OSEVENTS__
  21. #include <OSEvents.h>
  22. #endif
  23.  
  24. #ifndef __OSUTILS__
  25. #include <OSUtils.h>
  26. #endif
  27.  
  28. #ifndef __QUICKDRAW__
  29. #include <Quickdraw.h>
  30. #endif
  31.  
  32. #ifndef __TREEOBJ__
  33. #include "TreeObj.h"
  34. #endif
  35.  
  36. #ifndef __UTILITIES__
  37. #include "Utilities.h"
  38. #endif
  39.  
  40.  
  41.  
  42. /**********************************************************************/
  43. /**********************************************************************/
  44.  
  45. #ifdef applec
  46. #pragma segment ATGTreeObj
  47. #endif
  48.  
  49. /**********************************************************************/
  50. /**********************************************************************/
  51.  
  52.  
  53.  
  54. long    TUndoTaskObj(TreeObjHndl hndl, short message, long data)
  55. {
  56.     short    fileRefNum;
  57.     char    *cptr;
  58.     Point    pt;
  59.  
  60.     switch (message) {
  61.         case FREADMESSAGE:
  62.             fileRefNum = data;
  63.             return(ReadTreeObjData(hndl, fileRefNum));
  64.             break;
  65.  
  66.         case FWRITEMESSAGE:
  67.             fileRefNum = data;
  68.             return(WriteTreeObjData(hndl, fileRefNum));
  69.             break;
  70.  
  71.         case VHMESSAGE:
  72.             cptr = ((VHFormatDataPtr)data)->data;
  73.             ccatchr(cptr, 13, 2);
  74.             ccat   (cptr, "$10: TUndoTaskObj:");
  75.             ccatchr(cptr, 13, 1);
  76.             ccat   (cptr, "  $00: editType   = ");
  77.             ccatdec(cptr, mDerefUndoTask(hndl)->editType);
  78.             ccatchr(cptr, 13, 1);
  79.             ccat   (cptr, "  $02: undoOrigin = (");
  80.             pt = mDerefUndoTask(hndl)->undoOrigin;
  81.             ccatdec(cptr, pt.v);
  82.             ccat   (cptr, ",");
  83.             ccatdec(cptr, pt.h);
  84.             ccat   (cptr, ")");
  85.             ccatchr(cptr, 13, 1);
  86.             ccat   (cptr, "  $06: redoOrigin = (");
  87.             pt = mDerefUndoTask(hndl)->redoOrigin;
  88.             ccatdec(cptr, pt.v);
  89.             ccat   (cptr, ",");
  90.             ccatdec(cptr, pt.h);
  91.             ccat   (cptr, ")");
  92.             return(true);
  93.             break;
  94.  
  95.         default:
  96.             break;
  97.     }
  98.  
  99.     return(noErr);
  100. }
  101.  
  102.  
  103.  
  104.